Repository navigation
[sgl-router] Abort unfinished engine requests on cancellation - #40605
Open
sherlockwu wants to merge 1 commit into
Open
sherlockwu wants to merge 1 commit into
sherlockwu wants to merge 1 commit into
Conversation
sherlockwu
force-pushed
the
codex/router-engine-abort
branch
from
September 21, 2026 17:35
00aa895 to
c6db472
Compare
sherlockwu
added this pull request to stack #40625
September 21, 2026 20:36
sherlockwu
force-pushed
the
codex/router-engine-abort
branch
from
September 21, 2026 22:39
c6db472 to
509899c
Compare
sherlockwu
force-pushed
the
codex/router-engine-abort
branch
from
September 22, 2026 02:04
509899c to
d8953a9
Compare
ShangmingCai
force-pushed
the
codex/router-engine-abort
branch
from
September 22, 2026 03:13
d8953a9 to
c28b933
Compare
This was referenced Sep 22, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cancelled chat requests can leave the engine generating after the router releases its resources.
Modifications
Add a small abort guard for plain-mode dispatch and streaming. Preserve a caller's string
rid, otherwise inject a fresh UUID (gateway request IDs are reused across retries and the engine keys in-flight state byrid), and send a bounded, best-effort/abort_requestwhen forwarding ends unfinished. Completed responses and rejected streams disarm the guard; PD prefill keeps its existing lifetime.Stacked on #40604.
Accuracy Tests
Workspace library and integration tests passed after updating payload assertions for the injected ID. Added one compact regression covering unary/streaming cancellation, successful completion, ID preservation, and abort authorization.
cargo check --locked --workspace --all-targets, strict Clippy, and formatting passed.Speed Tests and Profiling
Not run; no inference changes.
CI States
Latest PR Test (Base): ✅ Run #35682350902
Latest PR Test (Extra): ❌ Run #35682350661
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.